<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
	    xmlns:p="http://primefaces.org/ui"
	    xmlns:hf="http://java.sun.com/jsf/composite/tags"
		xmlns:cc="http://java.sun.com/jsf/composite">

	<cc:interface>
		<cc:attribute name="linkId" required="true" />
		<cc:attribute name="value" required="true" />
		<cc:attribute name="view" required="true" />
		<cc:attribute name="entityId" required="true" />
		<cc:attribute name="entity" required="true" />
		<cc:attribute name="popupFields" />
	</cc:interface>
	
	<cc:implementation>
		<h:link id="#{cc.attrs.linkId}" value="#{cc.attrs.value}" outcome="#{cc.attrs.view}" >
    		<f:param name="objectId" value="#{cc.attrs.entityId}" />
    	</h:link>
		<cc:insertChildren />
    	
    	<p:tooltip rendered="#{not empty cc.attrs.popupFields}" for="#{cc.attrs.linkId}" showEffect="slide" hideEffect="slide">
			<ui:repeat value="#{cc.attrs.popupFields.split(',')}" var="entityFields">
               	<h:outputText style="white-space:nowrap" value="#{cc.attrs.entity[entityFields]}" /><br/>
            </ui:repeat>
        </p:tooltip>
	</cc:implementation>

</html>
